// 读取环境变量
const env = process.env.NODE_ENV || 'development'; // 默认为开发环境


export default function isLogin() {
	//用户没登录 就去授权登录
	const token = uni.getStorageSync('wxwork_token');
	if (!token) {
		//跳转授权地址 获取code
		//callBack是授权中间页
		const encodedTarget = encodeURIComponent('/pages/index/callBack');
		const authUrl =
			`https://jinzhizixun.com.cn/wx/yingyong/login?wantUrl=${encodedTarget}`;
		console.log('authUrl', authUrl);
		if (env === 'development') {
			console.log('当前是开发环境');
		} else if (env === 'production') {
			console.log('当前是生产环境');
			window.location.href = authUrl
		}
	}
}